package com.example.websocket_demo.service.message;

import com.example.websocket_demo.dao.message.MessageDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class MessageServiceImpl implements MessageService{
    @Autowired
    private MessageDao messageDao;

    @Override
    public int insertMessage(Map<String, Object> messageMap) {
        return messageDao.insertMessage(messageMap);
    }

    @Override
    public int deleteMessage(Integer id) {
        return messageDao.deleteMessage(id);
    }

    @Override
    public int updateMessage(Map<String, Object> messageMap) {
        return messageDao.updateMessage(messageMap);
    }

    @Override
    public List<Map<String, Object>> selectMessage(Map<String, Object> messageMap) {
        return messageDao.selectMessage(messageMap);
    }
    @Override
    public List<Map<String, Object>> selectMessageBySidOrRid(Map<String, Object> messageMap) {
        return messageDao.selectMessageBySidOrRid(messageMap);
    }

    @Override
    public List<Map<String, Object>> selectMessages() {
        return messageDao.selectMessages();
    }
}
